<template>
     <page-wrapper>
        <a-tabs type="card" :tabBarGutter="-1" @change="changeTab">
            <a-tab-pane key="1" tab="统计">
                <total-info :deptList="deptList" :staffList="staffList"/>
            </a-tab-pane>
            <a-tab-pane key="2" tab="详情">
                <list-info :deptList="deptList" :staffList="staffList"/>
            </a-tab-pane>
        </a-tabs>
    </page-wrapper>
</template>

<script>
import TableSearch from '@/components/tableSearch';
import TotalInfo from './components/total-info.vue';
import ListInfo from './components/list-info.vue'
import deptApi from '@/api/system/dept';
import staffApi from '@/api/system/staff'

export default {
    name:'TrainOperation',
    components:{
        TableSearch,
        TotalInfo,
        ListInfo
    },
    data(){
        return{
            deptList:[],
            staffList:[],
            tabIndex:1,
        }
    },
    created(){
        this.getResource()
    },
    methods:{
        changeTab(e){
            this.tabIndex = e;
        },
        //获取资源列表信息
        async getResource(){
            let deptResult = await deptApi.remoteList();
            this.deptList = deptResult.data;
            let res = await staffApi.remoteList({page:1,size:1000});
            let {list} = res.data;
            this.staffList = list;
        },
    }
}
</script>